<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns="urn:iNSISt:schemas:code-generation-1.0" elementFormDefault="qualified" targetNamespace="urn:iNSISt:schemas:code-generation-1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:complexType name="fileGroup">
    <xs:sequence>
      <xs:element maxOccurs="unbounded" name="file" type="xs:string" />
    </xs:sequence>
    <xs:attribute name="destination" use="required" />
  </xs:complexType>

  <xs:complexType name="shortcutGroup">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="unbounded" name="shortcut">
        <xs:complexType>
          <xs:simpleContent>
            <xs:extension base="xs:string">
              <xs:attribute name="target" use="required" />
              <xs:attribute name="parameters" />
              <xs:attribute name="icon" />
            </xs:extension>
          </xs:simpleContent>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
    <xs:attribute name="destination" type="xs:string" use="required" />
  </xs:complexType>
  
  <xs:element name="nsis">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="product">
          <xs:complexType>
            <xs:simpleContent>
              <xs:extension base="xs:string">
                <xs:attribute name="name" type="xs:string" use="required" />
                <xs:attribute name="version" type="xs:string" use="required" />
                <xs:attribute name="publisher" type="xs:string" use="required" />
              </xs:extension>
            </xs:simpleContent>
          </xs:complexType>
        </xs:element>
        <xs:element name="executable">
          <xs:complexType>
            <xs:simpleContent>
              <xs:extension base="xs:string">
                <xs:attribute name="path" type="xs:string" use="required" />
              </xs:extension>
            </xs:simpleContent>
          </xs:complexType>
        </xs:element>
        <xs:element name="outfile" type="xs:string" />
        <xs:element name="installDir">
          <xs:complexType>
            <xs:simpleContent>
              <xs:extension base="xs:string">
                <xs:attribute default="true" name="allowchange" type="xs:boolean" />
              </xs:extension>
            </xs:simpleContent>
          </xs:complexType>
        </xs:element>
        <xs:element name="mainSection" minOccurs="1" maxOccurs="1">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="fileGroup" minOccurs="0" maxOccurs="unbounded" type="fileGroup" />
              <xs:element name="shortcutGroup" minOccurs="0" maxOccurs="unbounded" type="shortcutGroup" />
            </xs:sequence>
            <xs:attribute name="description" type="xs:string" />
          </xs:complexType>
        </xs:element>
        <xs:element name="section" minOccurs="0" maxOccurs="unbounded">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="fileGroup" minOccurs="0" maxOccurs="unbounded" type="fileGroup" />
              <xs:element name="shortcutGroup" minOccurs="0" maxOccurs="unbounded" type="fileGroup" />
            </xs:sequence>
            <xs:attribute name="name" type="xs:string" use="required" />
            <xs:attribute name="style">
              <xs:simpleType>
                <xs:restriction base="xs:string">
                  <xs:enumeration value="bold" />
                  <xs:enumeration value="hidden" />
                </xs:restriction>
              </xs:simpleType>
            </xs:attribute>
            <xs:attribute default="true" name="selected" type="xs:boolean" />
            <xs:attribute name="index" type="xs:string" />
            <xs:attribute name="description" type="xs:string" />
          </xs:complexType>
        </xs:element>
        <xs:element name="ui" minOccurs="0">
          <xs:complexType>
            <xs:choice>
              <xs:element name="modernUI">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="installPages" minOccurs="0" maxOccurs="1">
                      <xs:complexType>
                        <xs:choice minOccurs="0" maxOccurs="unbounded">
                          <xs:element minOccurs="0" maxOccurs="unbounded" name="welcomePage">
                            <xs:complexType>
                              <xs:attribute default="false" name="threeLineTitle" type="xs:boolean" />
                              <xs:attribute name="title" type="xs:string" />
                              <xs:attribute name="text" type="xs:string" />
                            </xs:complexType>
                          </xs:element>
                          <xs:element minOccurs="0" maxOccurs="unbounded" name="licensePage">
                            <xs:complexType>
                              <xs:all>
                                <xs:element minOccurs="0" name="checkbox">
                                  <xs:complexType>
                                    <xs:attribute name="text" type="xs:string" />
                                  </xs:complexType>
                                </xs:element>
                                <xs:element minOccurs="0" name="radioButtons">
                                  <xs:complexType>
                                    <xs:attribute name="acceptText" type="xs:string" />
                                    <xs:attribute name="declineText" type="xs:string" />
                                  </xs:complexType>
                                </xs:element>
                              </xs:all>
                              <xs:attribute name="textFile" type="xs:string" use="required" />
                              <xs:attribute name="topText" type="xs:string" />
                              <xs:attribute name="bottomText" type="xs:string" />
                              <xs:attribute name="buttonText" type="xs:string" />
                            </xs:complexType>
                          </xs:element>
                          <xs:element minOccurs="0" maxOccurs="unbounded" name="componentsPage">
                            <xs:complexType>
                              <xs:attribute name="topText" type="xs:string" />
                              <xs:attribute name="componentsListText" type="xs:string" />
                              <xs:attribute name="installationTypeText" type="xs:string" />
                              <xs:attribute name="descriptionTitleText" type="xs:string" />
                              <xs:attribute name="descriptionInfoText" type="xs:string" />
                            </xs:complexType>
                          </xs:element>
                          <xs:element minOccurs="0" maxOccurs="unbounded" name="directoryPage">
                            <xs:complexType>
                              <xs:attribute name="topText" type="xs:string" />
                              <xs:attribute name="destinationText" type="xs:string" />
                              <!-- <xs:attribute name="variable" type="xs:string" /> -->
                              <xs:attribute default="false" name="verifyOnLeave" type="xs:boolean" />
                            </xs:complexType>
                          </xs:element>
                          <xs:element minOccurs="0" name="startMenuPage">
                            <xs:complexType>
                              <xs:attribute name="pageId" type="xs:string" use="required" />
                              <xs:attribute name="variable" type="xs:string" use="required" />
                              <xs:attribute name="topText" type="xs:string" />
                              <xs:attribute name="folderCheckboxText" type="xs:string" />
                              <xs:attribute name="defaultFolder" type="xs:string" />
                              <xs:attribute default="true" name="displayDisableShortcutsCheckbox" type="xs:boolean" />
                              <xs:attribute name="registryRoot" type="xs:string" />
                              <xs:attribute name="registryKey" type="xs:string" />
                              <xs:attribute name="registryValueName" type="xs:string" />
                            </xs:complexType>
                          </xs:element>
                          <xs:element minOccurs="0" maxOccurs="unbounded" name="instFilesPage">
                            <xs:complexType>
                              <xs:attribute name="finishHeaderText" type="xs:string" />
                              <xs:attribute name="finishHeaderSubText" type="xs:string" />
                              <xs:attribute name="abortHeaderText" type="xs:string" />
                              <xs:attribute name="abortHeaderSubText" type="xs:string" />
                            </xs:complexType>
                          </xs:element>
                          <xs:element minOccurs="0" maxOccurs="unbounded" name="finishPage">
                            <xs:complexType>
                              <xs:all>
                                <xs:element minOccurs="0" name="run">
                                  <xs:complexType>
                                    <xs:attribute name="file" type="xs:string" />
                                    <xs:attribute name="text" type="xs:string" />
                                    <xs:attribute name="parameters" type="xs:string" />
                                    <xs:attribute default="true" name="checked" type="xs:boolean" />
                                    <!-- <xs:attribute name="function" type="xs:string" /> -->
                                  </xs:complexType>
                                </xs:element>
                                <xs:element minOccurs="0" name="showReadMe">
                                  <xs:complexType>
                                    <xs:attribute name="file" type="xs:string" />
                                    <xs:attribute name="text" type="xs:string" />
                                    <xs:attribute default="true" name="checked" type="xs:boolean" />
                                    <!-- <xs:attribute name="function" type="xs:string" /> -->
                                  </xs:complexType>
                                </xs:element>
                                <xs:element minOccurs="0" name="link">
                                  <xs:complexType>
                                    <xs:attribute name="text" type="xs:string" />
                                    <xs:attribute name="location" type="xs:string" />
                                    <xs:attribute name="color" type="xs:string" />
                                  </xs:complexType>
                                </xs:element>
                              </xs:all>
                              <xs:attribute name="title" type="xs:string" />
                              <xs:attribute default="false" name="threeLineTitle" type="xs:boolean" />
                              <xs:attribute name="text" type="xs:string" />
                              <xs:attribute default="false" name="extraSpaceForText" type="xs:boolean" />
                              <xs:attribute name="buttonText" type="xs:string" />
                              <xs:attribute default="false" name="cancelEnabled" type="xs:boolean" />
                              <xs:attribute name="rebootText" type="xs:string" />
                              <xs:attribute name="rebootNowText" type="xs:string" />
                              <xs:attribute name="rebootLaterText" type="xs:string" />
                              <xs:attribute default="false" name="defaultToRebootLater" type="xs:boolean" />
                              <xs:attribute default="false" name="noRebootSupport" type="xs:boolean" />
                            </xs:complexType>
                          </xs:element>
                        </xs:choice>
                      </xs:complexType>
                    </xs:element>
                    <!--
                    <xs:element name="uninstallPages" minOccurs="0" maxOccurs="1">
                      <xs:complexType>
                        <xs:choice minOccurs="0" maxOccurs="unbounded">
                          <xs:element minOccurs="0" maxOccurs="unbounded" name="welcomePage" />
                          <xs:element minOccurs="0" maxOccurs="unbounded" name="confirmPage" />
                          <xs:element minOccurs="0" maxOccurs="unbounded" name="licensePage" />
                          <xs:element minOccurs="0" maxOccurs="unbounded" name="componentsPage" />
                          <xs:element minOccurs="0" maxOccurs="unbounded" name="directoryPage" />
                          <xs:element minOccurs="0" maxOccurs="unbounded" name="instFilesPage" />
                          <xs:element minOccurs="0" maxOccurs="unbounded" name="finishPage" />
                        </xs:choice>
                      </xs:complexType>
                    </xs:element>
                    -->
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:choice>
          </xs:complexType>
        </xs:element>
        <xs:element minOccurs="0" name="prerequisites">
          <xs:complexType>
            <xs:all>
              <xs:element name="dotNetFramework">
                <xs:complexType>
                  <xs:attribute name="version" use="required">
                    <xs:simpleType>
                      <xs:restriction base="xs:string">
                        <xs:enumeration value="2.0" />
                      </xs:restriction>
                    </xs:simpleType>
                  </xs:attribute>
                </xs:complexType>
              </xs:element>
            </xs:all>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>